
***********************************
***** Table - Courts v. Out *******   
***********************************

global controls "black hisp female"
global earncontrols "lquartearn1 lquartearn2 lquartearn3 lquartearn4 lemployedquart1 lemployedquart2 lemployedquart3 lemployedquart4 "

frame create barcompare str55 outcome str350 comparison beta se
foreach w in avgearn0t2 qemployed0t2 {
	
	** Bene v. Evicted (Demo controls)
	reghdfe `w' evictionorder $controls if (nonevictedcourts==0), absorb(filequarteryear Age std_zip5)
	frame post barcompare ("`w'") ("Bene v Evicted, Basic Controls") (_b[evictionorder]) (_se[evictionorder])

	** Courts v. Evicted (Demo controls)
	reghdfe `w' evicted $controls if (courts==1), absorb(filequarteryear Age std_zip5)
	frame post barcompare ("`w'") ("Not Evicted v  Evicted, Basic Controls") (_b[evicted]) (_se[evicted])
}
frame change barcompare

gen spec=""
replace spec="some_ctrls" if regexm(comparison, "Basic Controls")==1

gen samp2=""
replace samp2="acs_renter" if regexm(comparison, "Bene")==1
replace samp2="not_evicted" if regexm(comparison, "Not Evicted")==1

compress *

gen id=.
replace id=20 if comparison=="Bene v Evicted, Basic Controls"
replace id=40 if comparison=="Not Evicted v  Evicted, Basic Controls"
drop if id==.

frame barcompare: saveold "${Inputs}\NY_barchart_regs", replace
